package cn.wolfcode.crm.mapper;

import cn.wolfcode.crm.domain.Employee;
import cn.wolfcode.crm.query.QueryObject;
import org.apache.ibatis.annotations.Param;
import org.apache.poi.ss.usermodel.Workbook;

import java.util.List;

public interface EmployeeMapper {
    // 删除
    int deleteByPrimaryKey(Long id);

    // 添加
    int insert(Employee employee);

    // 根据 id 查询
    Employee selectByPrimaryKey(Long id);

    // 查询所有
    List<Employee> selectAll();

    // 根据 id 修改信息
    int updateByPrimaryKey(Employee employee);


    int selectForCount(QueryObject qo);
    // 分页查询所有信息
    List<Employee> selectForList(QueryObject qo);

    // 往中间表插入信息
    void insertRelation(@Param("employeeId") Long employeeId, @Param("roleId") Long roleId);

    // 从中间表删除信息
    void deleteRelation(Long employeeId);

    // 登录查询用户名和密码
    Employee selectByUsernameAndpassword(@Param("username") String username, @Param("password") String password);

    // 批量删除
    void deleteAll(@Param("ids") Long[] ids);

    // 判断用户名是否存在
    Employee selectByName(String name);

    Employee selectById(Long id);

    Employee selectByEmployeeId(Long id);

    Employee selectByPwd(String password);

    void updatePwd(@Param("id") Long id, @Param("newPassword") String newPassword);

    void updateStatus(@Param("id") Long id, @Param("status") boolean status);

    List<Employee> selectSellers(String[] roleName);

    List<Employee> selectName();

}